<template>
	<view>
		<!-- <u-navbar :is-back="true" :is-fixed="true" title="详情"></u-navbar> -->
		<scroll-view scroll-y scroll-with-animation style="height: calc(100vh - 50px);" :show-scrollbar="false">
			<u-field v-model="mobile" :border-bottom="false" label="申报状态" :disabled="true" input-align="right"
				:field-style="placeholderStyles">
			</u-field>
			<u-field v-model="mobile" :border-bottom="false" label="业务标题" :disabled="true" input-align="right"
				:field-style="placeholderStyle"></u-field>

			<u-field v-model="mobile" :border-bottom="false" label="申报说明" :disabled="true" input-align="right"
				:field-style="placeholderStyle"></u-field>

			<u-field v-model="mobile" :border-bottom="false" :disabled="true" label="开始时间" input-align="right"
				:field-style="placeholderStyle"></u-field>

			<u-field v-model="mobile" :border-bottom="false" :disabled="true" label="结束时间" input-align="right"
				:field-style="placeholderStyle"></u-field>

			<ferrButton title="点击报名" @click="click()"></ferrButton>

			<free-confirm ref="confirm" :title="confirmTitle">
				<u-form :model="form">
					<u-form-item :label-style="labelStyle" label-width="140" label="企业名称" prop="name">
						<u-input class="mr-3 " v-model="form.name" input-align="right" />
					</u-form-item>
					<u-form-item :label-style="labelStyle" label-width="180" label="营业执照编号" prop="name">
						<u-input class="mr-3 " v-model="form.name" input-align="right" />
					</u-form-item>
					<u-form-item :label-style="labelStyle" label-width="140" label="联系人" prop="name">
						<u-input class="mr-3 " v-model="form.name" input-align="right" />
					</u-form-item>
					<u-form-item :label-style="labelStyle" label-width="140" label="联系电话" prop="name">
						<u-input class="mr-3 " v-model="form.name" input-align="right" />
					</u-form-item>
					<u-form-item :label-style="labelStyle" label-width="140" label="成立时间" prop="name">
						<uni-calendar ref="calendar" :insert="false" @confirm="confirm" />
						<view v-if="!selectedDate" class="text-999999 right-1-5 position-absolute" @click="open">
							请选择日期</view>
						<view v-else class="right-1-5 position-absolute" @click="open">{{ selectedDate }}</view>
					</u-form-item>
				</u-form>
				<view class="flex-y py-3 pl-2 pr-2">
					<view class="">
						上传营业执照
					</view>
					<u-upload :action="action" max-count="1" :file-list="fileList"></u-upload>
				</view>

			</free-confirm>
		</scroll-view>
	</view>
</template>

<script>
	import ferrButton from "@/components/free-ui/ferr-button.vue";
	import freeConfirm from "@/components/free-ui/free-confirm.vue";
	export default {
		components: {
			ferrButton,
			freeConfirm
		},
		data() {
			return {
				selectedDate: null,
				mobile: '测试奢侈',
				placeholderStyle: {
					color: '#999'
				},
				placeholderStyles: {
					color: '#FFC251'
				},
				form: {
					name: '',
					intro: ''
				},
				confirmType: "",
				confirmText: '',
				// 演示地址，请勿直接使用
				action: 'http://www.example.com/upload',
				// fileList: [{
				// 	url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg',
				// }, ]
			}
		},
		computed: {
			confirmTitle() {
				return this.confirmType == 'username' ? '报名表' : '报名表'
			},
		},
		methods: {

			click() {
				this.$refs.confirm.show((close) => {
					if (this.confirmText === '') {
						uni.showToast({
							title: "不能为空",
							icon: 'none'
						});
						return;
					}

					this.user[key] = this.confirmText;
					uni.showToast({
						title: "修改成功",
						icon: 'none'
					});
					close();
				});
			},
			open() {
				this.$refs.calendar.open();
			},
			confirm(e) {
				this.selectedDate = e.fulldate;
			},
		}
	}
</script>

<style>

</style>